From f131e3e7c67227852d659f3d42726b3cf618f62e Mon Sep 17 00:00:00 2001 From: "riel@redhat.com[kaf24]" Date: Sat, 5 Mar 2005 11:24:07 +0000 Subject: [PATCH] bitkeeper revision 1.1236.1.61 (422996d7OS-GHHO0uCOWruz6V8AWXw) [PATCH] [PATCH] gcc4isms part 1 This patch gets rid of the compile warnings under the xen/ subdirectory, for an x86_32 compile. The cpuid change has also been sent to the upstream kernel. I am not quite sure about the vmx_platform.c bits, since __s8 should be the same as char, so gcc really shouldn't warn... Signed-off-by: Rik van Riel arch/x86/acpi.c | 2 +- arch/x86/domain_build.c | 2 +- arch/x86/pci-pc.c | 4 ++-- arch/x86/setup.c | 16 ++++++++-------- arch/x86/vmx.c | 2 +- arch/x86/vmx_platform.c | 20 ++++++++++---------- common/kernel.c | 2 +- drivers/char/console.c | 4 ++-- drivers/char/serial.c | 4 ++-- include/asm-x86/processor.h | 2 +- include/public/xen.h | 2 +- include/xen/serial.h | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) --- BitKeeper/etc/logging_ok | 1 + xen/arch/x86/acpi.c | 2 +- xen/arch/x86/domain_build.c | 2 +- xen/arch/x86/pci-pc.c | 4 ++-- xen/arch/x86/setup.c | 16 ++++++++-------- xen/arch/x86/vmx.c | 2 +- xen/arch/x86/vmx_platform.c | 20 ++++++++++---------- xen/common/kernel.c | 2 +- xen/drivers/char/console.c | 4 ++-- xen/drivers/char/serial.c | 4 ++-- xen/include/asm-x86/processor.h | 2 +- xen/include/public/xen.h | 2 +- xen/include/xen/serial.h | 2 +- 13 files changed, 32 insertions(+), 31 deletions(-) diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index db800169bc..a20c296edf 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -57,6 +57,7 @@ mwilli2@equilibrium.research.intel-research.net mwilli2@pug.(none) rac61@labyrinth.cl.cam.ac.uk rgr22@boulderdash.cl.cam.ac.uk +riel@redhat.com rminnich@lanl.gov rn@wyvis.camb.intel-research.net rn@wyvis.research.intel-research.net diff --git a/xen/arch/x86/acpi.c b/xen/arch/x86/acpi.c index 5bbd0cd272..8df006478a 100644 --- a/xen/arch/x86/acpi.c +++ b/xen/arch/x86/acpi.c @@ -97,7 +97,7 @@ char *__acpi_map_table(unsigned long phys, unsigned long size) mapped_size += PAGE_SIZE; } - return ((unsigned char *) base + offset); + return ((char *) base + offset); } diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 2948820db9..c8e378eb00 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -481,7 +481,7 @@ int construct_dom0(struct domain *d, si->mod_len, si->mod_start); } - dst = si->cmd_line; + dst = (char *)si->cmd_line; if ( cmdline != NULL ) { for ( i = 0; i < 255; i++ ) diff --git a/xen/arch/x86/pci-pc.c b/xen/arch/x86/pci-pc.c index 871fb81287..64ac8e0586 100644 --- a/xen/arch/x86/pci-pc.c +++ b/xen/arch/x86/pci-pc.c @@ -816,7 +816,7 @@ static int pci_bios_write (int seg, int bus, int dev, int fn, int reg, int len, static int pci_bios_read_config_byte(struct pci_dev *dev, int where, u8 *value) { int result; - u32 data; + u32 data = 0; if (!value) BUG(); @@ -832,7 +832,7 @@ static int pci_bios_read_config_byte(struct pci_dev *dev, int where, u8 *value) static int pci_bios_read_config_word(struct pci_dev *dev, int where, u16 *value) { int result; - u32 data; + u32 data = 0; if (!value) BUG(); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 79106593bb..b350229fd0 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -201,8 +201,8 @@ static void __init init_amd(struct cpuinfo_x86 *c) */ void __init identify_cpu(struct cpuinfo_x86 *c) { - int junk, i, cpu = smp_processor_id(); - u32 xlvl, tfms; + int i, cpu = smp_processor_id(); + u32 xlvl, tfms, junk; phys_proc_id[cpu] = cpu; logical_proc_id[cpu] = 0; @@ -217,10 +217,10 @@ void __init identify_cpu(struct cpuinfo_x86 *c) panic("Ancient processors not supported\n"); /* Get vendor name */ - cpuid(0x00000000, &c->cpuid_level, - (int *)&c->x86_vendor_id[0], - (int *)&c->x86_vendor_id[8], - (int *)&c->x86_vendor_id[4]); + cpuid(0x00000000, (unsigned int *)&c->cpuid_level, + (unsigned int *)&c->x86_vendor_id[0], + (unsigned int *)&c->x86_vendor_id[8], + (unsigned int *)&c->x86_vendor_id[4]); get_cpu_vendor(c); @@ -455,7 +455,7 @@ static void __init start_of_day(void) void __init __start_xen(multiboot_info_t *mbi) { - unsigned char *cmdline; + char *cmdline; module_t *mod = (module_t *)__va(mbi->mods_addr); void *heap_start; unsigned long firsthole_start, nr_pages; @@ -587,7 +587,7 @@ void __init __start_xen(multiboot_info_t *mbi) set_bit(DF_PRIVILEGED, &dom0->d_flags); /* Grab the DOM0 command line. Skip past the image name. */ - cmdline = (unsigned char *)(mod[0].string ? __va(mod[0].string) : NULL); + cmdline = (char *)(mod[0].string ? __va(mod[0].string) : NULL); if ( cmdline != NULL ) { while ( *cmdline == ' ' ) cmdline++; diff --git a/xen/arch/x86/vmx.c b/xen/arch/x86/vmx.c index 248e42bd64..047d4aa3ea 100644 --- a/xen/arch/x86/vmx.c +++ b/xen/arch/x86/vmx.c @@ -178,7 +178,7 @@ static void vmx_do_general_protection_fault(struct xen_regs *regs) static void vmx_vmexit_do_cpuid(unsigned long input, struct xen_regs *regs) { - int eax, ebx, ecx, edx; + unsigned int eax, ebx, ecx, edx; unsigned long eip; __vmread(GUEST_EIP, &eip); diff --git a/xen/arch/x86/vmx_platform.c b/xen/arch/x86/vmx_platform.c index 08d5e3d80a..ee84c716f0 100644 --- a/xen/arch/x86/vmx_platform.c +++ b/xen/arch/x86/vmx_platform.c @@ -290,7 +290,7 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst case 0xa4: /* movsb */ thread_inst->op_size = BYTE; - strcpy(thread_inst->i_name, "movs"); + strcpy((char *)thread_inst->i_name, "movs"); return DECODE_success; case 0xa5: @@ -300,7 +300,7 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst thread_inst->op_size = LONG; } - strcpy(thread_inst->i_name, "movs"); + strcpy((char *)thread_inst->i_name, "movs"); return DECODE_success; @@ -328,7 +328,7 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst return DECODE_failure; } - strcpy(thread_inst->i_name, "mov"); + strcpy((char *)thread_inst->i_name, "mov"); if (*inst != 0x0f) { return DECODE_success; } @@ -346,14 +346,14 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst } thread_inst->op_size = BYTE; - strcpy(thread_inst->i_name, "movzb"); + strcpy((char *)thread_inst->i_name, "movzb"); return DECODE_success; case 0xb7: thread_inst->op_size = WORD; index = get_index((inst + 1)); thread_inst->operand[1] = mk_operand(LONG, index, 0, REGISTER); - strcpy(thread_inst->i_name, "movzw"); + strcpy((char *)thread_inst->i_name, "movzw"); return DECODE_success; default: @@ -365,7 +365,7 @@ static int vmx_decode(const unsigned char *inst, struct instruction *thread_inst return DECODE_failure; } -static int inst_copy_from_guest(char *buf, unsigned long guest_eip, int inst_len) +static int inst_copy_from_guest(unsigned char *buf, unsigned long guest_eip, int inst_len) { unsigned long gpte; unsigned long mfn; @@ -382,7 +382,7 @@ static int inst_copy_from_guest(char *buf, unsigned long guest_eip, int inst_len ma = (mfn << PAGE_SHIFT) | (guest_eip & (PAGE_SIZE - 1)); inst_start = (unsigned char *)map_domain_mem(ma); - memcpy(buf, inst_start, inst_len); + memcpy((char *)buf, inst_start, inst_len); unmap_domain_mem(inst_start); } else { // Todo: In two page frames @@ -502,7 +502,7 @@ void handle_mmio(unsigned long va, unsigned long gpa) store_xen_regs(inst_decoder_regs); // Only handle "mov" and "movs" instructions! - if (!strncmp(mmio_inst.i_name, "movz", 4)) { + if (!strncmp((char *)mmio_inst.i_name, "movz", 4)) { if (read_from_mmio(&mmio_inst)) { // Send the request and waiting for return value. mpci_p->mmio_target = mmio_inst.operand[1] | WZEROEXTEND; @@ -514,7 +514,7 @@ void handle_mmio(unsigned long va, unsigned long gpa) } } - if (!strncmp(mmio_inst.i_name, "movs", 4)) { + if (!strncmp((char *)mmio_inst.i_name, "movs", 4)) { int tmp_dir; tmp_dir = ((va == inst_decoder_regs->edi) ? IOREQ_WRITE : IOREQ_READ); @@ -522,7 +522,7 @@ void handle_mmio(unsigned long va, unsigned long gpa) return; } - if (!strncmp(mmio_inst.i_name, "mov", 3)) { + if (!strncmp((char *)mmio_inst.i_name, "mov", 3)) { long value = 0; int size, index; diff --git a/xen/common/kernel.c b/xen/common/kernel.c index 9ae32fad1e..c6e7c213d8 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -16,7 +16,7 @@ void cmdline_parse(char *cmdline) { - unsigned char *opt_end, *opt; + char *opt_end, *opt; struct kernel_param *param; if ( cmdline == NULL ) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 31abeeed21..a69b5d19d8 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -22,7 +22,7 @@ #include /* opt_console: comma-separated list of console outputs. */ -static unsigned char opt_console[30] = OPT_CONSOLE_STR; +static char opt_console[30] = OPT_CONSOLE_STR; string_param("console", opt_console); /* opt_conswitch: a character pair controlling console switching. */ @@ -408,7 +408,7 @@ void set_printk_prefix(const char *prefix) void init_console(void) { - unsigned char *p; + char *p; /* Where should console output go? */ for ( p = opt_console; p != NULL; p = strchr(p, ',') ) diff --git a/xen/drivers/char/serial.c b/xen/drivers/char/serial.c index 868cabfb4d..99e1b1a42e 100644 --- a/xen/drivers/char/serial.c +++ b/xen/drivers/char/serial.c @@ -18,7 +18,7 @@ #include /* Config serial port with a string ,DPS,,. */ -static unsigned char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR; +static char opt_com1[30] = OPT_COM1_STR, opt_com2[30] = OPT_COM2_STR; string_param("com1", opt_com1); string_param("com2", opt_com2); @@ -395,7 +395,7 @@ void serial_putc(int handle, unsigned char c) __serial_putc(uart, handle, c); } -void serial_puts(int handle, const unsigned char *s) +void serial_puts(int handle, const char *s) { struct uart *uart = &com[handle & SERHND_IDX]; diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 3614d52db5..1570f6860f 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -192,7 +192,7 @@ extern void dodgy_tsc(void); /* * Generic CPUID function */ -static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx) +static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx) { __asm__("cpuid" : "=a" (*eax), diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h index a9222da7b6..87de21eb4b 100644 --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -428,7 +428,7 @@ typedef struct { _MEMORY_PADDING(F); memory_t mod_len; /* 56: Size (bytes) of pre-loaded module. */ _MEMORY_PADDING(G); - u8 cmd_line[MAX_CMDLINE]; /* 64 */ + s8 cmd_line[MAX_CMDLINE]; /* 64 */ } PACKED start_info_t; /* 320 bytes */ /* These flags are passed in the 'flags' field of start_info_t. */ diff --git a/xen/include/xen/serial.h b/xen/include/xen/serial.h index cb61a66c6b..60fd64186d 100644 --- a/xen/include/xen/serial.h +++ b/xen/include/xen/serial.h @@ -35,7 +35,7 @@ void serial_set_rx_handler(int handle, serial_rx_fn fn); void serial_putc(int handle, unsigned char c); /* Transmit a NULL-terminated string via the specified COM port. */ -void serial_puts(int handle, const unsigned char *s); +void serial_puts(int handle, const char *s); /* * An alternative to registering a character-receive hook. This function -- 2.30.2